//
//  BmyController.m
//  Ten
//
//  Created by anfuer on 2018/11/14.
//  Copyright © 2018年 xg韦. All rights reserved.
//

#import "BmyController.h"
#import "CollCell.h"
#import "MsgCell.h"

@interface BmyController ()
{
    NSArray*tbvdata;
    NSArray*colldata;
}
@property (weak, nonatomic) IBOutlet UITableView *tbv;
@property (weak, nonatomic) IBOutlet UICollectionView *collview;
@property (weak, nonatomic) IBOutlet UIView *layview;

@end

@implementation BmyController
-(void)viewDidAppear:(BOOL)animated{
    [super viewDidAppear:NO];
    [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent animated:YES];
    
}
-(void)viewWillDisappear:(BOOL)animated{
    [super viewWillDisappear:NO];
    [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault animated:YES];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    tbvdata=@[@"员工",@"薪资结算",@"意见反馈",@"联系客服"];
    colldata=@[@"被筛选",@"待沟通",@"已邀请",@"不适合"];
    _tbv.separatorColor=[UIColor clearColor];
    _layview.layer.shadowColor = [UIColor blackColor].CGColor;
    
    _layview.layer.shadowOpacity = 0.3f;
    
    _layview.layer.shadowRadius = 5;

    _layview.layer.shadowOffset = CGSizeMake(1,1);
  
    if (@available(iOS 11.0, *)){
        _tbv.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
        _tbv.contentInset = UIEdgeInsetsMake(0, 0, 49, 0);
    }else
    {
        self.automaticallyAdjustsScrollViewInsets = NO;
    }
    
    // Do any additional setup after loading the view.
}

#pragma mark 返回每组行数
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return  tbvdata.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath;
{
    static NSString *ID = @"MsgCell";
    MsgCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    NSString*tempstr=[NSString stringWithFormat:@"B%@",tbvdata[indexPath.row]];
    cell.img.image=WXGImage(tempstr);
    cell.lb1.text=tbvdata[indexPath.row];
    return cell;
}


#pragma mark 设置每行高度
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 50;
}
#pragma mark 点击事件
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath

{
    [MyUtils collviewSelidex:tbvdata[indexPath.row] toVc:self andShopInfo:nil];
}


#pragma  mark Coll相关

#pragma mark -- UICollectionViewDataSource 数据源方法
-(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath
{

        return CGSizeMake((DEVW-80)/4 ,80);

}
-(UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout insetForSectionAtIndex:(NSInteger)section
{
    
    return UIEdgeInsetsMake(0, 0, 0, 0);
}

- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
    return colldata.count;
}
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
    
    static NSString *ID = @"CollCell";
    CollCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:ID forIndexPath:indexPath];
    NSString*tempstr=[NSString stringWithFormat:@"B%@",colldata[indexPath.row]];
    cell.img.image=WXGImage(tempstr);
    cell.lb.text=colldata[indexPath.row];
   
    return cell;
}

#pragma mark --UICollectionViewDelegate

-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{

    
}



@end
